all: subdirs-all
$(MAKE) hvmloader
-hvmloader.o: roms.inc
+rombios.o hvmloader.o: roms.inc
smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(shell date +%m/%d/%Y)\""
hvmloader: $(OBJS) acpi/acpi.a
rm -f hvmloader.tmp
roms.inc: $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM) ../etherboot/eb-roms.h
- echo "/* Autogenerated file. DO NOT EDIT */" > roms.inc
+ echo "/* Autogenerated file. DO NOT EDIT */" > $@.new
ifneq ($(ROMBIOS_ROM),)
- echo "#ifdef ROM_INCLUDE_ROMBIOS" >> roms.inc
- sh ./mkhex rombios $(ROMBIOS_ROM) >> roms.inc
- echo "#endif" >> roms.inc
+ echo "#ifdef ROM_INCLUDE_ROMBIOS" >> $@.new
+ sh ./mkhex rombios $(ROMBIOS_ROM) >> $@.new
+ echo "#endif" >> $@.new
endif
ifneq ($(STDVGA_ROM),)
- echo "#ifdef ROM_INCLUDE_VGABIOS" >> roms.inc
- sh ./mkhex vgabios_stdvga $(STDVGA_ROM) >> roms.inc
- echo "#endif" >> roms.inc
+ echo "#ifdef ROM_INCLUDE_VGABIOS" >> $@.new
+ sh ./mkhex vgabios_stdvga $(STDVGA_ROM) >> $@.new
+ echo "#endif" >> $@.new
endif
ifneq ($(CIRRUSVGA_ROM),)
- echo "#ifdef ROM_INCLUDE_VGABIOS" >> roms.inc
- sh ./mkhex vgabios_cirrusvga $(CIRRUSVGA_ROM) >> roms.inc
- echo "#endif" >> roms.inc
+ echo "#ifdef ROM_INCLUDE_VGABIOS" >> $@.new
+ sh ./mkhex vgabios_cirrusvga $(CIRRUSVGA_ROM) >> $@.new
+ echo "#endif" >> $@.new
endif
- echo "#ifdef ROM_INCLUDE_ETHERBOOT" >> roms.inc
- cat ../etherboot/eb-roms.h >> roms.inc
- echo "#endif" >> roms.inc
+ echo "#ifdef ROM_INCLUDE_ETHERBOOT" >> $@.new
+ cat ../etherboot/eb-roms.h >> $@.new
+ echo "#endif" >> $@.new
+
+ mv $@.new $@
.PHONY: clean
clean: subdirs-clean
- rm -f roms.inc acpi.h
+ rm -f roms.inc roms.inc.new acpi.h
rm -f hvmloader hvmloader.tmp *.o $(DEPS)
-include $(DEPS)